package com.situ.crm.observer;

public class Client {
    public static void main(String[] args) {
        //创建一个报纸，作为目标
        NewsPaper newsPaper = new NewsPaper();
        //创建一个一个的读者
        Reader reader1 = new Reader("张三");
        Reader reader2 = new Reader("李四");
        Reader reader3 = new Reader("王五");
        //目标里面注册订阅者
        newsPaper.attach(reader1);
        newsPaper.attach(reader2);
        newsPaper.attach(reader3);
        newsPaper.setContent("本期内容是观察者模式");
    }
}
